<%--
  Created by IntelliJ IDEA.
  User: zhangxr103
  Date: 2014/10/21
  Time: 9:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%
    String phone = null;
    Object number = request.getParameter("number");
    Object passwd = request.getParameter("pass");
    if(request.getParameter("clear")==null){
        if (number != null && !number.toString().isEmpty() || (request.getSession().getAttribute("number") != null&&request.getSession().getAttribute("number") != null)) {
            if (number != null && !number.toString().isEmpty()) {
                request.getSession().setAttribute("number", number);
            }
            phone = request.getSession().getAttribute("number").toString();
            response.sendRedirect(request.getContextPath()+"/pages/show.jsp");
        }
    }else {
        request.removeAttribute("number");
        session.removeAttribute("number");
    }
%>

<html>
<head>
    <meta charset="utf-8">
    <title>credit-demo</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <script src="<%=request.getContextPath()%>/js/jquery/jquery-1.9.1.js" type="text/javascript"></script>
    <script src="<%=request.getContextPath()%>/js/bootstrap/bootstrap.min.js" type="text/javascript"></script>
    <script src="<%=request.getContextPath()%>/js/highcharts/highcharts.js" type="text/javascript"></script>
    <link href="<%=request.getContextPath()%>/css/bootstrap.min.css" rel="stylesheet" media="screen">

    <script>
        function sub_num() {
            var hl = "<button type='button' class='close' data-dismiss='alert'>×</button>";
            var emptyerr = "<strong>提示!</strong> 手机号不可为空.";
            var inputerr = "<strong>提示!</strong> 手机号不合法.";
            var wrongpass = "<strong>提示!</strong>密码不正确.";

            var pnum = $("#phonenumber").val();
            var passnum = $("#passwd").val();
            var regx = /^(?:13\d|15\d|18[123456789])-?\d{5}(\d{3}|\*{3})$/;
            if (!pnum) {
                $("#noticeid").html(hl + emptyerr);
            } else if (!regx.test(pnum)) {
                $("#noticeid").html(hl + inputerr);
            } else {
                if(passnum=='admin'){
                    $("#searchdata").submit();
                }else{
                    $("#noticeid").html(hl + wrongpass);
                }
            }


        }
        function KeyLogin(){
            if (event.keyCode==13){
                document.getElementById("login").click();
            }
        }

    </script>

    <style>

        #bottom{
            clear:both;font: 16px "Microsoft Yahei" ;color: #ffffff; position:absolute;bottom:0;text-align:center;vertical-align:middle;width:100%;border:0;
        }

        body{
            background: url('../img/p0.png') 50% 50% no-repeat;
            background-size: 100% 100%;
        }
    </style>
</head>
<body onkeydown="KeyLogin();">
<div class="container-fluid" style="font-family: 'Microsoft YaHei',serif">
    <div class="row-fluid">
        <div class="span12 text-center " style="background-color:#ecedf0;opacity:0.85;filter:alpha(opacity=50);width: 420px;height:330px;position:absolute;top:30%;left:35%">

            <div style="position: relative;padding-top: 30px;padding-bottom: 20px">
                <span style="font-family:'Microsoft YaHei',monospace;font-weight:bold;font-size: 26px;">个人征信查询平台</span>
            </div>

            <div style="width:80%;margin-left: 45px">
            <form id="searchdata" action="<%=request.getContextPath()%>/pages/startpage.jsp" class="text-center">
                    <div class="input-group input-group-lg text-center" >
                        <span class="input-group-addon"><img src="<%=request.getContextPath()%>/img/phone.png"/></span>
                        <input id="phonenumber" name="number" type="text" class="form-control" placeholder="请输入手机号码" style="padding: 9px 0 10px 0px" />
                    </div>
                    <div>
                        <br/>
                    </div>
                    <div class="input-group input-group-lg text-center" >
                        <span class="input-group-addon"><img src="<%=request.getContextPath()%>/img/passwd.png"/></span>
                        <input id="passwd" name="pass" type="password" class="form-control" placeholder="请输入密码" style="padding: 9px 0 10px 0px" />
                    </div>
            </form>
            </div>


            <div>
                <button id="login" type="button" class="btn" style="width:250px;height: 38px;text-align:center;margin-top: 10px" onclick="sub_num()">查&nbsp;&nbsp;找</button>
            </div>


            <div id="noticeid" class="alert">
                <button type="button" class="close text-left" data-dismiss="alert">×</button>
                <h5>提示：请输入要查询征信的手机号码。</h5>
            </div>
        </div>
    </div>
</div>
<div id="bottom"><span>版权所有@中国联合网络通信有限公司研究院</span></div>
</body>
</html>
